package com.gf.forcesystem.mq.weatherparse;

import com.gf.forcesystem.model.dto.weather.AbstractWeather;
import com.gf.forcesystem.model.dto.weather.Snow;
import org.springframework.stereotype.Service;

import java.nio.ByteBuffer;

/**
 * @author gaofei
 * @date 2022/6/24 21:32
 */
@Service("SnowParse")
public class SnowParse implements IWeatherParse{
    @Override
    public byte identifier() {
        return (byte)0xC4;
    }

    @Override
    public AbstractWeather parse(ByteBuffer byteBuffer) {
        Snow snow = new Snow();
        snow.setType(byteBuffer.get());
        return snow;
    }
}
